home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / admin-header.php < prev    next >
Encoding:
PHP Script  |  2004-10-06  |  3.8 KB  |  134 lines

  1. <?php
  2.  
  3. require_once('../wp-config.php');
  4. require_once(ABSPATH.'/wp-admin/auth.php');
  5. require(ABSPATH.'/wp-admin/admin-functions.php');
  6.  
  7. // Disallow direct loading of this file
  8. if( basename(__FILE__) == basename($_SERVER['PHP_SELF']) ) {
  9.         die(__("Direct access denied."));
  10. }
  11.  
  12. function gethelp_link($this_file, $helptag) {
  13.     $url = 'http://wordpress.org/docs/reference/links/#'.$helptag;
  14.     $s = ' <a href="'.$url.'" title="' . __('Click here for help') .'">?</a>';
  15.     return $s;
  16. }
  17.  
  18. if (!isset($blogID))    $blog_ID=1;
  19. if (!isset($debug))        $debug=0;
  20. timer_start();
  21.  
  22. $dogs = $wpdb->get_results("SELECT * FROM $tablecategories WHERE 1=1");
  23. foreach ($dogs as $catt) {
  24.     $cache_categories[$catt->cat_ID] = $catt;
  25. }
  26.  
  27. get_currentuserinfo();
  28.  
  29. $posts_per_page = get_settings('posts_per_page');
  30. $what_to_show = get_settings('what_to_show');
  31. $archive_mode = get_settings('archive_mode');
  32. $date_format = stripslashes(get_settings('date_format'));
  33. $time_format = stripslashes(get_settings('time_format'));
  34.  
  35. // let's deactivate quicktags on IE Mac and Lynx, because they don't work there.
  36. if (($is_macIE) || ($is_lynx))
  37.     $use_quicktags = 0;
  38.  
  39. $wpvarstoreset = array('profile','standalone','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
  40. for ($i=0; $i<count($wpvarstoreset); $i += 1) {
  41.     $wpvar = $wpvarstoreset[$i];
  42.     if (!isset($$wpvar)) {
  43.         if (empty($_POST["$wpvar"])) {
  44.             if (empty($_GET["$wpvar"])) {
  45.                 $$wpvar = '';
  46.             } else {
  47.                 $$wpvar = $_GET["$wpvar"];
  48.             }
  49.         } else {
  50.             $$wpvar = $_POST["$wpvar"];
  51.         }
  52.     }
  53. }
  54.  
  55. if ($standalone == 0) :
  56.  
  57. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  58. <html xmlns="http://www.w3.org/1999/xhtml">
  59. <head>
  60. <title>WordPress › <?php bloginfo('name') ?> › <?php echo $title; ?></title>
  61. <link rel="stylesheet" href="wp-admin.css" type="text/css" />
  62. <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
  63. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
  64.  
  65. <?php if (isset($xfn)) : ?>
  66. <script language="javascript" type="text/javascript">
  67. //<![CDATA[
  68.  
  69. function GetElementsWithClassName(elementName, className) {
  70.     var allElements = document.getElementsByTagName(elementName);
  71.     var elemColl = new Array();
  72.     for (i = 0; i < allElements.length; i++) {
  73.         if (allElements[i].className == className) {
  74.             elemColl[elemColl.length] = allElements[i];
  75.         }
  76.     }
  77.     return elemColl;
  78. }
  79.  
  80. function blurry() {
  81.     if (!document.getElementById) return;
  82.     
  83.     var aInputs = document.getElementsByTagName('input');
  84.     
  85.     for (var i = 0; i < aInputs.length; i++) {      
  86.         aInputs[i].onclick = function() {
  87.             var inputColl = GetElementsWithClassName('input','valinp');
  88.             var rel = document.getElementById('rel');
  89.             var inputs = '';
  90.             for (i = 0; i < inputColl.length; i++) {
  91.                 if (inputColl[i].checked) {
  92.                 if (inputColl[i].value != '') inputs += inputColl[i].value + ' ';
  93.                 }
  94.             }
  95.             inputs = inputs.substr(0,inputs.length - 1);
  96.             if (rel != null) {
  97.                 rel.value = inputs;
  98.             }
  99.         }
  100.         
  101.         aInputs[i].onkeyup = function() {
  102.             var inputColl = GetElementsWithClassName('input','valinp');
  103.             var rel = document.getElementById('rel');
  104.             var inputs = '';
  105.             for (i = 0; i < inputColl.length; i++) {
  106.                 if (inputColl[i].checked) {
  107.                     inputs += inputColl[i].value + ' ';
  108.                 }
  109.             }
  110.             inputs = inputs.substr(0,inputs.length - 1);
  111.             if (rel != null) {
  112.                 rel.value = inputs;
  113.             }
  114.         }
  115.         
  116.     }
  117. }
  118.  
  119. window.onload = blurry;
  120. //]]>
  121. </script>
  122. <?php endif; ?>
  123.  
  124. <?php do_action('admin_head', ''); ?>
  125. </head>
  126. <body>
  127. <div id="wphead">
  128. <h1><a href="http://wordpress.org" rel="external" title="<?php _e('Visit WordPress.org') ?>"><?php _e('WordPress') ?></a></h1>
  129. </div>
  130.  
  131. <?php
  132. require('./menu.php');
  133. endif;
  134. ?>